#include <iostream>
#include <vector>
#include <string>
#include <queue>

using namespace std;

// 1208. 尽可能使字符串相等
// https://leetcode.cn/problems/get-equal-substrings-within-budget/description/

class Solution {
public:
    int equalSubstring(string s, string t, int maxCost) {
        int ans = 0;
        int curCost = 0;
        int curLeft = 0;
        int n = s.size();
        for (int i = 0; i < n; i++)
        {
            curCost += abs(s[i] - t[i]);
            while(curCost > maxCost){
                curCost -= abs(s[curLeft] - t[curLeft]);
                curLeft++;
            }
            ans = max(ans, i - curLeft + 1);
        }
        return ans;
    }
};

int main()
{
    return 0;
}